package club.hicode.daydayup.netty.demo.server;

import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.handler.codec.DelimiterBasedFrameDecoder;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;
import io.netty.util.concurrent.DefaultEventExecutorGroup;
import io.netty.util.concurrent.EventExecutorGroup;
import lombok.extern.slf4j.Slf4j;

/**
 * 自己的 ChannelInBoundHandler
 *
 * @author Liu Chunfu
 * @date 2018-06-14 下午2:58
 **/
@Slf4j
public class MyParentChannelInitializer extends ChannelInitializer {


    /**
     * 分隔符
     */
    private static final String DELIMITER = "$";

    static final EventExecutorGroup group = new DefaultEventExecutorGroup(16);

    @Override
    protected void initChannel(Channel channel) throws Exception {
        ChannelPipeline pipeline = channel.pipeline();

        System.out.println("Parent :" + Thread.currentThread().getId());
        //channel.pipeline().addLast("myHandler", new MyHandler());
    }

}
